function applySignUp(orgPk, classpk) {
	if (confirm("确定要报名吗？")) {
		regApplySignUp(orgPk, classpk);
	}
}
function regApplySignUp(orgPk, classpk) {
	if (classpk.substring(0, 1) == "p") {
		var publicPk = classpk.substring(1);
		alert(publicPk);
		$.getJSON("orgstudentclasspublic_signApply?organization.pk=" + orgPk
				+ "&classpublic.pk=" + publicPk + "&now=" + new Date(),
				function(data) {
					var checkdata = data.checkdata;
					if (checkdata == -1) {
						showregAndLogin(orgPk, publicPk);
					} else if (checkdata == -11) {
						alert("讲座已经报满");
						return;
					} else if (checkdata == -12) {
						alert("您已经报名了此讲座，请耐心等待");
						return;
					} else if (checkdata == 0) {
						shoueapplyresult(data);
					}
				});
	} else {
		$.getJSON("courseleaning_signApply?organization.pk=" + orgPk
				+ "&classlist.pk=" + classpk + "&now=" + new Date(), function(
				data) {
			var checkdata = data.checkdata;
			if (checkdata == -1) {
				showregAndLogin(orgPk, classpk);
			} else if (checkdata == -11) {
				alert("课程已经报满");
				return;
			} else if (checkdata == -12) {
				alert("您已经报名了此课程，请耐心等待");
				return;
			} else if (checkdata == 0) {
				shoueapplyresult(data);
			}
		});
	}
}

function applySignUp(orgPk, classpk, className) {
	if (confirm("确定要报名吗？")) {
		regApplySignUp(orgPk, classpk, className);
	}
}

function regApplySignUp(orgPk, classpk, className) {
	classpk=classpk+"";
	if (classpk.substring(0, 1) == "p") {
		var publicPk = classpk.substring(1);
		regApplySignUpPublic(orgPk, publicPk, className);
	} else {
		$.getJSON("courseleaning_signApply?organization.pk=" + orgPk
				+ "&classlist.pk=" + classpk + "&now=" + new Date(), function(
				data) {
			var checkdata = data.checkdata;
			if (checkdata == -1) {
				showregAndLogin(orgPk, classpk, className);
			} else if (checkdata == -11) {
				alert("课程已经报满");
				return;
			} else if (checkdata == -12) {
				alert("您已经报名了此课程，请耐心等待");
				return;
			} else if (checkdata == 0) {
				shoueapplyresult(data);
			}
		});
	}
}

function applySignUpPublic(orgPk, publicpk, publicName) {
	if (confirm("确定要报名吗？")) {
		regApplySignUpPublic(orgPk, publicpk, publicName);
	}
}

function regApplySignUpPublic(orgPk, publicpk, publicName) {
	$.getJSON("courseleaning_signApplyPublic?organization.pk=" + orgPk
			+ "&classPublic.pk=" + publicpk + "&now=" + new Date(), function(
			data) {
		var checkdata = data.checkdata;
		if (checkdata == -1) {
			showregAndLoginPublic(orgPk, publicpk, publicName);
		} else if (checkdata == -11) {
			alert("讲座已经报满");
			return;
		} else if (checkdata == -12) {
			alert("您已经报名了此讲座，请耐心等待");
			return;
		} else if (checkdata == 0) {
			shoueapplypublicresult(data);
		}
	});
}